package org.liuyunfeng.web;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @author: TanJingyu
 * @create: 2023-02-06 11:28
 **/
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/create")
    public String createOrder() {
        rabbitTemplate.convertAndSend("order", UUID.randomUUID());
        return "true";
    }
}

    